package com.it.base.arithmetic.base.dm.chain.filters;

import com.it.base.arithmetic.base.dm.chain.PreparationList;
import com.it.base.arithmetic.base.dm.chain.FilterChain;
import com.it.base.arithmetic.base.dm.chain.StudyPrepareFilter;
public class HaveBreakfastFilter implements StudyPrepareFilter {

    //每一次自己处理完，就把数据传递给下一个节点出来，
    @Override
    public void doFilter(PreparationList preparationList, FilterChain filterChain) {
        //如果满足当前的处理对象条件，则本对象处理，并且处理完之后，传递给下一个节点
        if (preparationList.isWashHair()) {
            System.out.println("洗头");
        }
        //传递给下一个对象处理
        filterChain.doFilter(preparationList, filterChain);
    }
}
